package com.yc.myspringboot.listener.demo1;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;

/**
 * 事件发布
 * @author yuancan
 *
 */
@Component
public class EventDemoPublish {

	@Autowired
	private ApplicationEventPublisher applicationEventPublisher;
	
	public void publish(String message) {
		EventDemo eventDemo = new EventDemo(this, message);
		applicationEventPublisher.publishEvent(eventDemo);
	}

}
